package com.cn.kabalifeuser.ui.order.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.cn.kabalifeuser.R;
import com.cn.kabalifeuser.ui.order.bean.OrderListListBean;
import com.cn.kabalifeuser.utils.GlideUtil;

import java.util.List;

/**
 * Created by 晓林 on 2020/9/14.
 * function:
 */
public class OrderItemAdapter extends BaseQuickAdapter<OrderListListBean.ResultBean.DataBean.GoodsBean, BaseViewHolder> {
    public OrderItemAdapter(int layoutResId, @Nullable List<OrderListListBean.ResultBean.DataBean.GoodsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, OrderListListBean.ResultBean.DataBean.GoodsBean item) {
        GlideUtil.ImageLoad(this.mContext, item.getGood_img(), helper.getView(R.id.good_img));
        helper.setText(R.id.tv_title, item.getTitle())
                .setText(R.id.tv_spec_key, item.getSpec_key())
                .setText(R.id.tv_money, item.getOriginal_price())
                .setText(R.id.tv_good_num, "x " + item.getGood_num());
    }
}
